<?php
require_once './application/core/CoreBase.php';
require_once './application/entity/admin/configini.php';

class readAdm extends CoreBase
{
    private $_configPath;
    private $_config;
    private $_sonde;
    private $_server;
    private $_user;
    private $_pass;
    private $_database;
    private $_graphiz;
    private $_obj;
    private $_tmpPath;

    public function __construct( &$controller )
    {
        parent::__construct( $controller );
        $this->_configPath = './application/configuration/config.ini';
        $this->_config = new Zend_Config_Ini( $this->_configPath, null );
        $this->_server = $this->_config->database->database->params->host;
        $this->_user = $this->_config->database->database->params->username;
        $this->_pass = $this->_config->database->database->params->password;
        $this->_database = $this->_config->database->database->params->dbname;
        $this->_graphiz = $this->_config->topologie->graphviz->location;
        $this->_tmpPath = $this->_config->topologie->generation->pathTmp;
        $this->_sonde = $this->_config->sonde->sonde->location;
    }

    public function readIni()
    {
        $this->_obj = new configIni();
        $this->_obj->server = $this->_server;
        $this->_obj->db = $this->_database;
        $this->_obj->user = $this->_user;
        $this->_obj->pass = $this->_pass;
        $this->_obj->graphiz = $this->_graphiz;
        $this->_obj->sonde = $this->_sonde;
        $this->_obj->tmpPath = $this->_tmpPath;
         echo Zend_Json_Encoder::encode( $this->_obj );
    }
    
}